<template>
    <div>
        {{$route.path}}
        <ul class="nav nav-pills nav-stacked">
        <li role="presentation" :class="item.to === $route.path ? 'active' : ''" v-for="item in links" :key="item.id">
            <router-link :to="item.to">{{item.text}}</router-link>
        </li>
        </ul>
    </div>
</template>
<script>
export default {
    data() {
        return {
            links:[
                {id:1,text:'首页',to:'/'},
                {id:2,text:'学生管理',to:'/student'},
                {id:3,text:'班级管理',to:'/class'},
                {id:4,text:'专业管理',to:'/major'}
            ]
        }
    },
}
</script>
<style lang="less">
    
</style>